<div class="row">
    <div class="col-md-12">
        <div class="table-responsive">
            <table class="table table-bordered table-hover tablesorter item-list" data-href='<?php echo admin_page_url(ADVERTISE_SLUG.'/dang-ki/cap-nhat'); ?>'>
                <thead>
                    <tr>
                        <th class="header"># <i class="fa fa-sort"></i></th>
                        <th class="header">Người đăng <i class="fa fa-sort"></i></th>
                        <th class="header">Thông tin</i></th>
                        <th class="header">Ghi chú</th>
                        <th class="header">Ngày đăng kí <i class="fa fa-sort"></i></th>
                        <th class="header"></th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($aAdvertiseRegister as $index=>$ad) { ?>
                    <tr class="can-edit" data-id="<?php echo $this->encrypt->encode($ad->getId()); ?>">
                        <th class="header bg-info"><?php echo $index+1; ?></th>
                        <td>
                            <?php
                                if($ad->getUserId()!=''){
                                    echo $ad->full_name;
                            ?>
                            <h4 class="mgt10">
                                <label class="label label-success">
                                    <i class="glyphicon glyphicon-ok-sign"></i>
                                    Người dùng hệ thống
                                </label>
                            </h4>
                            <?php
                                } else {
                                    $opt_info = unserialize($ad->getOptInfo());
                                    echo $opt_info['name'];
                            ?>
                            <h4 class="mgt10">
                                <label class="label label-warning">
                                    <i class="glyphicon glyphicon-ok-sign"></i>
                                    Khách
                                </label>
                            </h4>
                            <?php
                                }
                            ?>
                        </td>
                        <td class="input-advertise-position">
                            <p><strong>Vị trí: </strong> <?php echo $aPosition[$ad->getPosition()]; ?></p>
                            <div class="mgt5">
                                <p><strong>Ngày bắt đầu: </strong><?php echo fdate_format($ad->getStartDate()); ?></p>
                                <p><strong>Ngày kết thúc: </strong><?php echo fdate_format($ad->getEndDate()); ?></p>
                            </div>
                            <div class="btn-group mgt5">
                                <a class="btn btn-default" target="_blank" href="<?php echo $ad->getAnchor();?>" title="Đi đến <?php echo $ad->getAnchor();?>">
                                    <i class="glyphicon glyphicon-share-alt"></i> Đi đến
                                </a>
                                <a class="btn btn-primary" href="<?php echo get_upload_advertise($ad->getFileName()); ?>" title="<?php echo $ad->getFileName(); ?>">
                                    <i class="glyphicon glyphicon-circle-arrow-down"></i> Tải về
                                </a>
                            </div>
                        </td>
                        <td class="input-advertise-note">
                            <?php echo $ad->getNote(); ?>
                        </td>
                        <td class="input-advertise-create-date">
                            <?php echo fdate_format($ad->getCreatedAt(), 'Y-m-d H:i:s'); ?>
                        </td>
                        <td class="input-advertise-flg">
                            <input id="chk-tad-delete-<?php echo $index + 1; ?>" class="checkbox lb-toggle red" data-name="delete_flg" type="checkbox" <?php echo ($ad->getDeletedAt())!=NULL?"checked='checked'":''; ?> />
                            <label for="chk-tad-delete-<?php echo $index + 1; ?>"></label>
                        </td>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="clearfix"></div>
</div>

<div class="modal fade" id="modal-ad-preview">
    <div class="modal-dialog modal-sm">
        <div class="modal-content"></div>
    </div>
</div>